/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mvp.levelup.oop2;

import java.util.Random;

/**
 *
 * @author WORKSPOT2
 */
public class Bow implements IWeapon
{
    private int arrows;
    private int power;
    
    @Override
    public int attack()
    {
        arrows--;
        return 5;
    }

    @Override
    public boolean upgrade(int chance)
    {
        Random r = new Random();
        int randomNumber = r.nextInt(100);
        if(randomNumber < chance){
            power++;
            return true;
        }
        return false;
    }

    @Override
    public void breakUp()
    {
        power = 0;
        arrows = 0;
    }

    @Override
    public String getName()
    {
       return "Bow";
    }
    
}
